'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    const { INTEGER, DATE, STRING } = Sequelize;
    await queryInterface.createTable('refresh_tokens', {
      refresh_token: { type: STRING(50), primaryKey: true},
      expires_at: DATE,
      scope: STRING(30),
      client_id: STRING(50),
      user_id: INTEGER,
      created_at: DATE,
      updated_at: DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable('refresh_tokens');
  }
};
